﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ch05
{
    class Class1
    {
        static void Main(string[] args)
        {
            /*
            //先定义及实例化
            int[] nums = new int[3];
            //后进行赋值
            nums[0] = 88;
            nums[1] = 66;
            nums[2] = 99;
            */

            //定义数组的同时赋初始值
            //int[] nums = new int[3] { 88, 66, 99 };
            //如果给了初始值，new int[3]可以省略不写
            int[] nums = { 88, 66, 99 };

            foreach (int n in nums)
            {
                Console.WriteLine(n);
            }

        }
    }
}
